<!-- 工作台 -->
<template>
  <div class="workbench">
    <div class="title">
      <h2>工作台</h2>
      <el-icon :size="20" class="icon" @click="handleReset">
        <Refresh />
      </el-icon>
    </div>
    <slot />
  </div>
</template>

<script lang="ts" setup>
import { Refresh } from '@element-plus/icons-vue'
const emits = defineEmits(['reset'])

function handleReset() {
  emits('reset')
}
</script>

<style lang="less" scoped>
.workbench {
  width: 360px;
  border-left: 1px solid var(--el-border-color);
  box-sizing: border-box;
  color: var(--el-color-black);

  .title {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 50px;
    margin-bottom: 8px;
    padding-left: 16px;
    padding-top: 8px;

    h2 {
      font-size: 20px;
      font-weight: bold;
      margin-right: 8px;
    }

    .icon {
      position: relative;
      top: 2px;
      transition: all 0.2s linear;
      cursor: pointer;

      &:hover {
        transform-origin: center;
        transform: rotate(140deg);
        color: var(--el-color-primary);
      }
    }
  }
}
</style>
